jsx3.Class.defineClass(
    "tibco.admin.monitormanage.serviceHeaderButton.ServiceHeaderButton", //the full name of the class to create
    jsx3.lang.Object, //  extends
    [tibco.admin.monitormanage.uicomponents.page.serviceView.ServiceHeaderInterface], // implements
    function (plugin) {
        plugin.instance = null;
        plugin.prototype.serviceId = null;
        plugin.prototype.resourceType = null;
                    
        plugin.getInstance = function(args) {
            if(!this.instance) {
                this.instance = new tibco.admin.monitormanage.serviceHeaderButton.ServiceHeaderButton();
            }
            return this.instance;
        }
        
        plugin.prototype.initPlugin = function() {
            tibco.admin.Main.loadResource("tibco/admin/monitormanage/serviceHeaderButton/jss/jss.xml", "tibco.admin", "jss000", "ljss", false);
        }
        
        plugin.prototype.destroyPlugin = function() {
        }
        
        plugin.prototype.getNamespace = function() {
           return "tibco.admin";
        }
        
        plugin.prototype.updateComponent = function(serviceId, resourceType) {
    				this.serviceId = serviceId;
    				this.resourceType = resourceType;
        }
        
        plugin.prototype.loadComponent = function(parent) {
            tibco.admin.Main.loadUIResourceAsync(parent, this.getNamespace(), "tibco/admin/monitormanage/serviceHeaderButton/ui/serviceHeaderButton.xml", this, this.componentLoaded);
        }
        
        plugin.prototype.componentLoaded = function(objEvent) {
            if(objEvent.status == "SUCCESS") {
                this.block = objEvent.obj;
                this.block.handler = this;
                if(this.resourceType == "COMPOSITE_SERVICE") {
                    this.block.setDisplay(jsx3.gui.Block.DISPLAYBLOCK, true);
                } else {
                    this.block.setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                }
            }
        }
        
        plugin.prototype.openGenWSDLDlg = function() {
            var GenWSDLDlg = APP.tibco.admin.getBodyBlock().load("tibco/admin/monitormanage/wsdlGen/ui/wsdlGen.xml");
            GenWSDLDlg.serviceId = this.serviceId;
            GenWSDLDlg.callgenerateWSDL();
        }
    });